#ifndef _BODY_H_
#define _BODY_H_

#define BODY_STAT_TIME  0x01
#define BODY_STAT_DATE  0x02


#define BODY_LH		0x01
#define BODY_RH		0x02
#define BODY_HAZ	0x04
#define BODY_SIDE	0x08
#define BODY_DIP	0x10
#define	BODY_MAIN	0x18
#define BODY_FOG	0x20
#define BODY_DOOR	0x40
#define BODY_ERROR	0x80

#define BODY_LIGHTS ((BODY_flags >> 3) & 0x03)


typedef struct {
	uint8_t hour;
	uint8_t minute;
	uint8_t second;
	uint8_t year;
	uint8_t month;
	uint8_t day;
} stDateTime_t;

extern uint8_t BODY_CAN_count;

extern uint8_t BODY_flags;
extern uint8_t BODY_ambient;	//ambient temperature div2 and 20 offset
extern uint8_t BODY_status;
extern uint8_t BODY_ADC[5];
extern uint8_t BODY_PortA, BODY_PortB, BODY_PortC, BODY_PortD;

extern stDateTime_t BODY_time;


void BODY_init( void );
void BODY_task100ms( void );
void BODY_setTime( stDateTime_t *pTime );
void BODY_setDate( stDateTime_t *pTime );

#endif
